from nekoTrace.nekonekotrace.models import *
# check if the user is new, if yes, add an item in the DB
def checkNewUser(rrId, apiClient):
    try:
        p = OpenUser.objects.get(id = rrId)
    except OpenUser.DoesNotExist:
        #print "New User"
        # now install it into the DB
        
        params = {"method": "users.getInfo", "fields": "name"}
        response = apiClient.request(params)
        print response
        nu = OpenUser(id = rrId, Name = response[0][u'name'])
        nu.save()
    